#include "framework.h"
								

#if defined(NUVOTON)
	//use uart0
	//#define USER_CONFIG()												MODIFY_HIRC_166();P06_PushPull_Mode();P07_Input_Mode();//initialize RXD & TXD PINS.
	
	//use uart1
	#define USER_CONFIG()												MODIFY_HIRC_166();P16_PushPull_Mode();P02_Input_Mode();//initialize RXD_1 & TXD_1 PINS.
#elif defined(STC)
	#define USER_CONFIG()											
#elif defined(SINONE)
	#define USER_CONFIG()	
#else
	#define USER_CONFIG()
#endif



unsigned char rxbuff[32] = {0};
unsigned char rxlen = 0;

void main(void)
{
	USER_CONFIG();
	uart0_init(115200, 0, 0);
	INTERRUPT_ENABLE();

	for(;;)
	{
		rxlen = uart0_read(rxbuff, sizeof(rxbuff)/sizeof(unsigned char));
		if(rxlen > 0)
		{
			uart0_write(rxbuff, rxlen);
		}
	}
}


